home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 April
/
EnigmA AMIGA RUN 26 (1998)(G.R. Edizioni)(IT)[!][issue 1998-04].iso
/
classx
/
util
/
xfa_util
/
arexx
/
adpro_animtoxfa.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-03-09
|
4KB
|
90 lines
/*
** Anim To XFA REQUESTER - ADPro Arexx Script Converter
**
** This code shows how to open a File Requester
** For setting Input Anim Name and Output Anim Name.
**
** This code (C)Copyright Fabio Rotondo.
** It is given as Freeware example and may not be used
** for any commercial product.
**
*/
ADDRESS "XFA.1" /* Let's ADDRESS XFA */
CountFormat ""
SetPath ADPro "ADPro:ADPro" /* Set ADPro Path */
CallProcessor ADPro /* Call ADPro */
ADDRESS "ADPro" /* Let's ADDRESS ADPro */
LFORMAT "ANIM" /* InputFile is an ANIM File */
SFORMAT "IFF" /* We have to save it as an IFF */
INTERFACE_SIZE TINY
OPTIONS RESULTS
sparename = "T:Frame" /* Name of file to be processed */
/* Here we ask for an Anim File name for input */
GETFILE '"Select An Anim File To Convert"'
IF RC = 10 THEN abort() /* If user press cancel, we abort the script */
animname = ADPRO_RESULT /* We store ANIM file name into animname */
/* Here we ask for a Output XFA Anim File Name for output */
GETFILE '"Save XFA Anim as..."'
IF RC = 10 THEN abort() /* Same as Above...*/
outname = ADPRO_RESULT
frames = 0 /* Number of frames of the Anim */
LOAD animname COUNT /* Let's count the Anim Frames */
frames = ADPRO_RESULT-2 /* frames = ADPro's Result */
LOAD animname FRAME 1 /* Now we load the 1st Frame */
EXECUTE /* We render it into ADPro */
PSTATUS LOCKED /* And Lock The Palette next */
/* Frames will be remapped is */
/* We need it. (Multi pal anims)*/
SAVE sparename||0 IMAGE /* Save it into T:Frame0 */
ADDRESS "XFA.1" /* Now we call XFA (port is XFA.1) */
FirstFrame 0 /* We Set FirstFrame to 0 */
LastFrame frames /* We Set LastFrame to Anim Frames */
Compression 32I /* Set Compression to 32I */
CloseAnim LOOP /* Set AnimClose Mode to LOOP */
InputName sparename /* Input Root Name is T:Frame */
OutputName outname /* XFA Animation Name will be T:a.xfa */
SetProcessor ADPro /* We Select ImageProcessor Program */
InitXFA /* XFA Initialization */
/* NOTE: BEFORE call InitXFA you have */
/* To perform AT LEAST all settings */
/* We have done inside this example. */
/* Also remember of having the FIRST */
/* Frame of the ANIM saved as IFF, for*/
/* Configuring correctly XFA */
DO t=1 TO frames /* For t=1 TO NFrames... */
ADDRESS "ADPro" /* Call ADPro */
LOAD animname FRAME t /* Load Frame N */
EXECUTE /* Render It */
x = t-1
n = sparename||x
SAVE n IMAGE /* Save Picture */
ADDRESS "XFA.1" /* Call XFA */
GetFrame (t-1) /* Load This Frame */
PutFrame /* Put It Inside Anim */
END /* Next */
CloseXFA /* Here We Close XFA Anim*/
Message '"Conversion done."'
ADDRESS "ADPro"
PSTATUS UNLOCKED
exit /* End Of Arexx Script!! */
abort:
ADDRESS "XFA.1"
Message '"Operation Aborted By The User."'
exit(0)